
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
const router = new VueRouter({
    mode: 'hash',
    routes:[
        {
            path: '/',
            redirect: '/login'
        },
        { 
            path: '/register', 
            name: 'Register',
            component: () => import('@/views/Register.vue')
        },
        {
            path: '/login',
            name: 'Login',
            component: () => import('@/views/Login.vue')
        },
        {
            path: '/admin',
            name: 'Admin',
            meta: {name: '后台管理', icon: 'el-icon-setting'},
            component: () => import('@/views/Admin.vue'),
            children: [
                {
                    path: 'customer',
                    meta: {name: '客户管理', icon: 'el-icon-s-custom'},
                    component: () => import('@/views/admin/customer.vue'),
                    children: [
                        {
                            path: 'base',
                            query:{
                                pageSize: 5,
                                pageNum: 1
                            },
                            meta: {name: '客户信息管理', icon: 'el-icon-setting'},
                            component: () => import('@/views/admin/customer.vue'),
                        },
                    ]
                },
                {
                    path: 'driver',
                    meta: {name: '运货管理', icon: 'el-icon-truck'},
                    component: () => import('@/views/admin/driver.vue'),
                    children: [
                        {
                            path: 'base',
                            meta: {name: '运货师傅信息管理', icon: 'el-icon-setting'},
                            query:{
                                pageNum: 1,
                                pageSize: 5
                            },
                            component: () => import('@/views/admin/driver.vue')
                        },
                    ]
                },
                {
                    path: 'transport',
                    meta: {name: '物流管理', icon: 'el-icon-place'},
                    component: () => import('@/views/admin/transport.vue'),
                    children: [
                        {
                            path: 'base',
                            meta: {name: '物流信息管理', icon: 'el-icon-setting'},
                            component: () => import('@/views/admin/transport.vue')
                        },
                    ]
                },
                
            ]
        }
    ],
})

export default router